Update on the Drag-and-Drop Issue: Root Cause Identified
I've identified the bug: The issue is caused by running the application as Administrator, not by having Microsoft PowerToys FancyZones enabled.
Thank you to everyone who provided feedback on this issue. After further investigation, I've determined that the primary cause of the drag-and-drop failure is running the PySide6 application with administrator privileges, not the presence of Microsoft PowerToys FancyZones.
Root Cause Clarification
Windows implements strict security isolation between processes running at different privilege levels. When a PySide6 application runs with administrator rights, it operates in a different security context than most desktop applications (including Windows Explorer, which typically runs at standard user level). This isolation prevents the cross-process communication necessary for drag-and-drop operations to function properly, resulting in the forbidden symbol (đźš«).
Recommended Solution
Run your PySide6 application at standard user privilege level (without administrator rights). This is the most straightforward solution and maintains normal drag-and-drop functionality.
If your application genuinely requires elevated privileges for certain operations, consider:
Implementing alternative file selection methods in your UI (e.g., QFileDialog for file opens, command-line argument support, or copy/paste path handling).
Restructuring your application so that only the specific components needing elevated privileges run as administrator, while the main GUI runs at standard user level.
Why FancyZones Might Have Seemed Related
PowerToys FancyZones, which manages window layouts, might have interacted visibly with the window of an elevated application, potentially making the issue more noticeable. However, the core permission isolation issue lies with the administrator privilege level itself.
Verification
You can verify this by running the provided example code without administrator privileges. Drag-and-drop should function correctly, even with FancyZones enabled.
Apologies for the initial confusion regarding FancyZones, and I hope this clarification helps others experiencing similar issues.